package com.hll.service;

import com.hll.dao.UserDao;

/**
 * @author: Mr.Hu
 * @create: 2021-03-11 12:53
 */
public class UserServiceImpl implements UserService {
  private UserDao userDao;
  // 强耦合的方式,如果要更换实现UserDaoMySqlImpl,就要改代码
  /* private UserDao userDao = new UserDaoImpl();*/

  // 依赖注入,client可以指定相应UserDao实现方式,而源程序无需更改代码
  public void setUserDao(UserDao userDao) {
    this.userDao = userDao;
  }

  @Override
  public void getUser() {
    userDao.getUser();
  }
}
